#include const int triggerPin = 6; const int echoPin = 7; const int maxDistance = 200; NewPing sonar(triggerPin, echoPin, maxDistance); void setup() { Serial.begin(9600); } void loop() { delay(100); Serial.print("Ping: "); Serial.print(sonar.ping_cm()); Serial.println("cm"); }